<template>
  <div class="index all">
    <div class="all_left">
      <left></left>
    </div>
    <div class="all_right">
      <div class="all1">

33333333333333333

222222

        访问人数：1001231223456
        <vuexTest></vuexTest>
12312313
        ttttttttttttttttttttttttttttttttttttttttttttt
        t2tttttttt2
        <vuexTest2></vuexTest2>
      </div>
    </div>
  </div>
</template>
<script>

  import CryptoJS from 'crypto-js'
  import left from '@/components/left.vue'
  import vuexTest from '@/pages/vuex_test.vue'
  import vuexTest2 from '@/pages/vuex_test2.vue'
  export default {
    name: 'index',
    components:{
      left,vuexTest,vuexTest2
    },
    data() {
      return {

      }
    },
    created() {
      // let x = this.encrypt(37068319901218)
      // console.log(x)
      // console.log(this.decrypt('9gVJMLrxcbsuOCIReM9Iyg=='))
      var y= parseInt('b204fbc8d2614e6eb46d2ddb53c5c5ad', 16);//十六进制转为十进制

      var z= y.toString(2);//十进制转为2进制

      console.log(z,this.decrypt(z));


    },
    mounted() {

    },
    methods: {
      encrypt:function(word){
        let keyStr = "ofGlyFgu9bL2J7VQ54mHaNSDYpr8EqCM"
      	var key  = CryptoJS.enc.Utf8.parse(keyStr);//Latin1 w8m31+Yy/Nw6thPsMpO5fg==
      	var srcs = CryptoJS.enc.Utf8.parse(word);
      	var encrypted = CryptoJS.AES.encrypt(srcs, key, {mode:CryptoJS.mode.ECB,padding: CryptoJS.pad.Pkcs7},1);
      	return encrypted.toString();
      },
      decrypt:function(word){

        let keyStr = "ofGlyFgu9bL2J7VQ54mHaNSDYpr8EqCM"
      	var key  = CryptoJS.enc.Utf8.parse(keyStr);//Latin1 w8m31+Yy/Nw6thPsMpO5fg==
      	var decrypt = CryptoJS.AES.decrypt(word, key, {mode:CryptoJS.mode.ECB,padding: CryptoJS.pad.Pkcs7},1);
      	return CryptoJS.enc.Utf8.stringify(decrypt).toString();
      }
    }
  }
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="less">
  .index{
    /deep/ .el-input__inner{ background: rgba(0,0,0,0.1); color:#FFFFFF;}
    /deep/ .el-button--primary{  background: rgba(0,0,0,0.1); border:1px #FFFFFF solid;}
    /deep/ .el-table tr{ background: transparent;}
    /deep/ .el-table th.el-table__cell{ background: transparent;}
    /deep/ .el-table, .el-table__expanded-cell{ background: transparent;}
  }
</style>
